Skip to content

Conversation

@etlioglu
Copy link
Contributor

@etlioglu etlioglu commented Jan 8, 2026

Minor change for i) keeping track of data types within .col prior to feeding an AnnData object to sc.pp.scrublet(), ii) enforcing these types to the respective columns of the data frame returned by sc.pp.scrublet().

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.01%. Comparing base (45766a8) to head (e85f07c).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3939   +/-   ##
=======================================
  Coverage   78.01%   78.01%           
=======================================
  Files         117      117           
  Lines       12466    12466           
=======================================
  Hits         9725     9725           
  Misses       2741     2741           
Flag Coverage Δ
hatch-test.low-vers 77.33% <100.00%> (ø)
hatch-test.pre 76.96% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/scanpy/preprocessing/_scrublet/__init__.py 96.84% <100.00%> (ø)

@flying-sheep
Copy link
Member

thanks! I simplified this a bit: pandas.DataFrame.astype accepts a mapping of column → dtype, which adata.obs.dtypes happens to be.

@flying-sheep flying-sheep changed the title Preserving dtypes when running scrublet fix: preserving dtypes when running scrublet Jan 12, 2026
@flying-sheep flying-sheep changed the title fix: preserving dtypes when running scrublet fix: preserve dtypes when running scrublet Jan 12, 2026
@flying-sheep flying-sheep added this to the 1.12.0 milestone Jan 12, 2026
@flying-sheep flying-sheep merged commit b417678 into scverse:main Jan 12, 2026
17 of 20 checks passed
@etlioglu etlioglu deleted the scrublet-dtypes branch January 12, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sc.pp.scrublet() is overwriting dtypes when being run with the "batch_key" parameter

2 participants